<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ page import = "com.hexacta.hrs.securitygroups.SecurityGroup" %>

<head>
	<sx:head cache="false" />
	<link rel="stylesheet" href="/hrs-intranet/styles/displaytag.css" type="text/css" />
</head>

<s:if test="hasFieldErrors()">
	<div class="oldErrorMsg">
		<h4 class="oldErrorTitle">Error(s) with submission:</h4>
		<s:iterator value="fieldErrors">
			<s:iterator value="value">
				<li>
					<font class="errorMsgFont">
						<s:property/>
					</font>
				</li>
			</s:iterator>
		</s:iterator>
	</div>
	<br/>
	<br/>
</s:if>

<s:form action="ManageSecurityGroupAction_list" cssClass="formClass" >
  
    <script type="text/javascript">
		function clickOK() {
			document.getElementById('okbtn').click();
		}

		function Func1Delay()
		{
			setTimeout("clickOK()", 100);
		}
		
		function confirmRemove( url ) 
		{
			if ( confirm("Do you confirm to remove the selected security group?") )
			{
				document.forms[0].action = url;
		  		document.forms[0].submit();
			}
		}
	</script>

</s:form>


<display:table id="securityGroups" name="listModel" requestURI="ManageSecurityGroupAction_list" class="listable" cellpadding="0" cellspacing="0" pagesize="12"  >
  <display:column property="name" title="Security Group Name" sortable="true"/>
  <display:column property="description" title="Description" sortable="true"/>
  <s:url id="view_action" action="ManageSecurityGroupAction_show" />
  <s:url id="remove_action" action="ManageSecurityGroupAction_validateDelete"  />
  <display:column  title="Options" >

 	<s:if test="hasPermission(permissionNameConverter.getViewSecurityGroupPermission())" >
    		<a	href="${view_action}?requestId=${securityGroups.id}" >View</a>
  	</s:if>

 	<s:if test="hasPermission(permissionNameConverter.getDeleteSecurityGroupPermission())">		
   		<% if (!((SecurityGroup)securityGroups).isOfSystem()) {  %>
    		&nbsp;&nbsp;&nbsp; <a	href="javascript:confirmRemove('${remove_action}?requestId=${securityGroups.id}')">Remove</a>
   		<% } %>
 	</s:if>

  </display:column>
</display:table>
